home *** CD-ROM | disk | FTP | other *** search
/ The Business Master (3rd Edition) / The Business Master (3rd Edition).iso / files / utilfile / lptx700 / lptx.doc < prev    next >
Encoding:
Text File  |  1989-02-19  |  11.5 KB  |  261 lines

  1. LPTx : Line Printer Output Capture Routine
  2.  
  3. ------------------------------------------------------------------------
  4.  
  5.  Version 7.00
  6.  
  7.  (C)    Copyright 1987 by Mark DiVecchio, All Rights Reserved
  8.  (C)    Copyright 1987 by Kepa Zubeldia,  All Rights Reserved
  9.  
  10. DISCLAMER : This program tries to perform a function which is not supported
  11. by DOS. It will work sometime and will not work other times. That kind of
  12. explains why you don't see this type of program on the market. I have
  13. tested it under DOS 2.x and 3.x. In particular, under 3.x, I used dBase-II.
  14. I have not tested it with dBase-III or dBase-III+.
  15.  
  16.  Mark C. DiVecchio
  17.  10435 Mountain Glen Terrace
  18.  San Diego, CA 92131
  19.  619-549-4056
  20.  619-566-6810
  21.  RBBS 619-549-3927  (for the latest version of LPTx)
  22.  
  23. ------------------------------------------------------------------------
  24.  
  25.         First - some thanks...  I would like to thank all of the users who
  26. have called me about the earlier versions of LPTx which has been floating
  27. around for about a year. The program has met with mixed success. There
  28. seems to be no pattern as to when the program works and when it doesn't. I
  29. am still searching for the solution to this very difficult problem. This
  30. version and versions 4.x and 5.x which preceeded it are attempts to perform
  31. the same function with a different algorithm. Version 3.00, 4.00, 5.00 and
  32. 6.00 are not replacements or upgrades of each other but just alternative
  33. implementations. Version 7.00 is version 6.00 with a pop-up window.
  34.  
  35.     A special word of Thanks to Kepa Zubeldia who added the
  36. enhancements for version 7.00.
  37.  
  38. ------------------------------------------------------------------------
  39.  
  40.         Have you ever wanted to get some data from your screen into a
  41. program? Have you ever wanted to grab onto some printer data and put it
  42. into a disk file but the program you are using does not have that as a
  43. option? Well here is the answer to your problem. This program will grab
  44. onto anything sent out of a line printer port as long as the program uses
  45. the standard BIOS INT 17h call. This version works with Shift-PrtSc or
  46. Ctrl-PrtSc but does not work with the DOS TYPE command.
  47.  
  48.         This program intercepts the BIOS interrupt 17h, the line printer
  49. interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
  50. file. All three redirections may be active at the same time.
  51.  
  52.         This version of LPTx counts on the PC having some "free time" in
  53. order to write the data to disk. The program gathers data into a large
  54. buffer and during timer interrupts and keyboard idle periods, it writes it
  55. to disk. DOS must not be in its critical section for the write to take
  56. place. LPTx does not work with the DOS TYPE apparently because the critical
  57. section flag is always set when the timer interrupts occur. It should work
  58. with most user programs since the critical section flag is not set in user
  59. programs and therefore will not be set when timer interrupts occur.
  60.  
  61.         Look at the Assembly Language Source which you should have received
  62. with this documentation file. If you would like the other versions of LPTx,
  63. I will be happy to send them to you. Just send me a formatted 360K DSDD
  64. floppy (no DOS on diskette) along with a post-paid, self-addressed floppy
  65. mailer. I will send you all current versions that are active. If you
  66. received this disk directly from me, all of the different versions are
  67. already on the diskette.
  68.  
  69.         LPTx requires DOS 2.0 or later. It has been tested on version 3.1
  70. of DOS as well.
  71.  
  72. Calling sequence:
  73. lptx [?] [-m] [-x] [-l] [-i] {-1,-2,-3} {-c -o -a <d:[pathname]filename>}
  74.  
  75. where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
  76.          LPT3
  77.          This option must appear first
  78.  
  79.       -o means start the redirection to file specified. If redirection
  80.          is already in progress for the selected line printer,
  81.          the old file will be closed first.
  82.          (If you do not specify -o but you do specify a line printer,
  83.          LPTx will use either the last file name that you gave when
  84.          you loaded LPTx or will use the file named LPTXy.LST which it
  85.          will create in the root directory on the default drive - where
  86.          y is 1, 2, or 3.)
  87.  
  88.          It is not necessary that you specify the complete path name
  89.          for the file. LPTx will create the file in the default 
  90.          directory if you don't specify a directory. LPTx will always
  91.          be able to find the file because it saves the complete path.
  92.  
  93.       -a means the same as -o except that if there was a file with the same
  94.          name already on the disk, it will append the text to that file
  95.          without asking the user for confirmation. In order for this to
  96.          work properly, the file on the disk must NOT be terminated by
  97.          a control-Z (1Ah). Otherwise you may not be able to see the text
  98.          that will be appended after the control-Z.
  99.  
  100.          LPTx will not put a control-Z at the end of its files. If you
  101.          need a control-Z at the end, you can use the copy command, with
  102.          the concatenation option (copy x+y z) to add a control-Z. See
  103.          your DOS manual.
  104.  
  105.         -c means close the file and send all further output directly to the
  106.          line printer.
  107.  
  108.          If neither the -o or the -c option is specified, LPTx just displays
  109.          the program status.
  110.  
  111.  
  112.         -? displays a short help screen.
  113.  
  114.         -x tells LPTx to ignore the DOS Critical Section Flag. Use this
  115.          option only with great care. LPTx may do unusual things if the
  116.          flag is ignored.
  117.  
  118.         -l tells LPTx to strip linefeed characters from the data as it is
  119.          being redirected.
  120.  
  121.         -i removes LPTx from the interrupt chain. This effectively inactivates
  122.          the program. The memory which it occupies is not freed.
  123.  
  124.         -m the first time LPTx is run, tells the pop-up window to ignore
  125.          the color card and use monochrome attributes. Makes a more readable
  126.          screen on monochrome monitors with graphics adaptor cards.
  127.         
  128. note: -1, -2, and -3 are mutually exclusive
  129.         -o and -c are mutually exclusive
  130.  
  131. examples:
  132.  
  133. lptx                            Displays the program status
  134.  
  135. lptx ?                          Displays a HELP screen
  136.  
  137. lptx -1                         redirects LPT1 output to file named
  138.                                 LPTX1.LST in the root directory
  139.                                 on the default drive or the last
  140.                                 named file.
  141.  
  142. lptx -o a:\able.xxx             redirects LPT1 output to file named
  143.         or                      a:\able.xxx. Any open redirection
  144. lptx a:\able.xxx                disk file for LPT1 is closed.
  145.  
  146. lptx -2 b:xx.lst                redirects LPT2 output to file named
  147.                                 XX.LST in the default directory
  148.                                 on drive B:. Any open redirection
  149.                                 disk file for LPT2 is closed.
  150.  
  151. lptx -3 d:\ab\cd\file.lst       redirects LPT3 output to the file named
  152.                                 file.lst in the directory ab\cd on drive
  153.                                 d:.
  154.  
  155. lptx -c                         closes any disk files open for LPT1 and sends
  156.         or                      the output back to the line printer
  157. lptx -1 -c                      If no redirection is taking place to LPT1,
  158.                                 this is a NOP. LPT2 and LPT3 are not
  159.                                 affected.
  160.  
  161. lptx -2 -c                      closes any disk file open for LPT2 and
  162.                                 sends the output back to line printer.
  163.                                 if no redirection is taking place to LPT2,
  164.                                 this is a NOP. LPT1 and LPT3 are not
  165.                                 affected.
  166.  
  167.         By redirecting LPT2 or LPT3 to a disk file, you can in effect have
  168. 2 or 3 printers on your system. LPT1 can be your physical printer and you
  169. can have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1
  170. works normally.
  171.  
  172.         If you are redirecting to a diskette file, do not remove the
  173. diskette once the redirection starts. I recommend redirecting to a hard
  174. disk or a RAM disk.
  175.  
  176.         If LPTx encounters any kind of error during the redirection, it
  177. terminates operation and sends output back to the line printer. It does not
  178. display anything but beeps the speaker. Four beeps indicates a DOS disk
  179. access error. Two beeps indicates an internal buffer overflow error. This
  180. prevents your currently running program from possibly getting destroyed. An
  181. error with LPT1 redirection does not shut down LPT2 or LPT3 redirection.
  182.  
  183.         LPTx captures the int 17h interrupt vector. Problems may occur with
  184. print spoolers which also take over the int 17h  vector. You can be sure
  185. that LPTx works correctly by running LPTx before you run your print
  186. spooler. LPTx will be transparent to the print spooler but your print
  187. spooler may not be transparent to LPTx. LPTx works fine with IBM's PRINT
  188. command.
  189.  
  190.         LPTx also captures the int 24h critical error interrupt vector.
  191. This is done only for the period that LPTx is using the disk. This prevents
  192. the generation of funny error messages in the middle of other programs that
  193. you may be running. (LPTx just beeps 4 times and clears itself out of way
  194. if a disk error occurs).
  195.  
  196.         This version of LPTx can redirect all three printers to three
  197. different files with all 3 active at the same time.
  198.  
  199.         LPTx worked correctly when I tested it with:
  200.  
  201.         1. dBaseII,
  202.  
  203.         2. the ARC utility with the "p" option and output redirected to prn,
  204.  
  205.         3. shift PrtSc,
  206.  
  207.         4. DOS PRINT utility,
  208.  
  209.         5. Lotus 123,
  210.  
  211.         6. dir > prn,
  212.  
  213.         LPTx did not work with:
  214.  
  215.         1. The DOS TYPE command,
  216.  
  217.         2. The DOS COPY command,
  218.  
  219.         3.
  220.  
  221.         Version 6.00 of LPTx uses about 20K of memory for the resident data
  222. buffers and interrupt handler. This is greater than the previous versions
  223. of LPTx because I made the disk buffers larger.
  224.  
  225.         If you modify or find any bugs in this program, I would appreciate
  226. it if you would drop me a line with the changes. Use the address above. 
  227.  
  228.         Updates and new versions of this program can be found on the RBBS
  229. at 619-549-3927.
  230.  
  231.         Version 7.00 contains the code for a pop-up window that allows the
  232. user to turn the redirection ON or OFF from within an application program.
  233. This window has been tested with Monochrome, Color, and EGA adaptor cards,
  234. and with monochrome and color monitors. If DOS is busy when you try to open
  235. the window, you will get no response. In these cases, hold down Alt-PrtSc
  236. until the window opens. You can only redirect printers to files that have 
  237. been previously opened with the command line version of LPTx. 
  238.  
  239. For Example :
  240.  
  241.     You first must start LPTx from the command line as usual :
  242.  
  243. lptx output.fil
  244.  
  245.     Then you can press Alt-PrtSc and a pop-up window will appear.
  246. When it does, the up and down arrow keys select a printer and the
  247. right and left arrow keys select redirection. The pop-up will state
  248. "to file" or "to printer" indicating the state of the redirection.
  249.  
  250.     Press <Enter> or <Esc> to close the window.
  251.  
  252.     Remember that you must start LPTx from the command line before
  253. the pop-up will let you turn redirection on or off.
  254.  
  255.  
  256.         Another change in LPTx version 7.00 is the capability of appending
  257. to an existing file, instead of having to use a new file every time. This
  258. feature forced the sacrifice of the control-Z added at the end of the file.
  259.  
  260. Version 7.00 now assembles under Microsoft 5.0
  261.